package com.sti.platform.jobs;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.aisino.core.common.JsonPost;
import com.aisino.core.controller.BaseController;
import com.aisino.tools.util.WebConstants;
import com.sti.platform.service.BackupService;
@Component
public class DbBackupJobs  extends BaseController {

	@Autowired
	private BackupService backupService;
	
	//@Scheduled(cron="0/10 * *  * * ? ") 
	public  void  add(){
		 super.jsonPost(new JsonPost() {
			@SuppressWarnings("unchecked")
			@Override
			public void doInstancePost(Map arg0) {
				arg0.put(WebConstants.JSON_MESSAGE, backupService.add("1"));
			}
		});
	}
	
}
